From: Keir Fraser Date: Mon, 31 Aug 2009 08:54:25 +0000 (+0100) Subject: x86_emulate: honor failure of in_longmode() X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13409 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=2ea33061b38d5997323293da150b1bda8c6beba2;p=xen.git x86_emulate: honor failure of in_longmode() Failure of in_longmode() shouldn't be treated the same as the function returning 'true'. Signed-off-by: Jan Beulich --- diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c index 5f8361e2b2..f2dfdf0c19 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -3605,7 +3605,10 @@ x86_emulate( ss.attr.bytes = 0xc93; /* G+DB+P+S+Data */ #ifdef __x86_64__ - if ( in_longmode(ctxt, ops) ) + rc = in_longmode(ctxt, ops); + if ( rc < 0 ) + goto cannot_emulate; + if ( rc ) { cs.attr.fields.db = 0; cs.attr.fields.l = 1; @@ -3777,7 +3780,10 @@ x86_emulate( ss.limit = ~0u; /* 4GB limit */ ss.attr.bytes = 0xc93; /* G+DB+P+S+Data */ - if ( in_longmode(ctxt, ops) ) + rc = in_longmode(ctxt, ops); + if ( rc < 0 ) + goto cannot_emulate; + if ( rc ) { cs.attr.fields.db = 0; cs.attr.fields.l = 1;